/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * StatisticsPage.java
 *
 * Created on 02/04/2011, 12:59:58
 */

package wf.ui.layouts;

import bc.dsl.PageDSL;
import bc.swing.pfrm.Page;
import bc.swing.pfrm.PageLayout;

/**
 *
 * @author bennyl
 */
public class StatisticsLayout extends javax.swing.JPanel implements PageLayout{
    public static final String AVAILABLE_STATISTICS_ROLE = "AVAILABLE STATISTICS ROLE";
    public static final String CHART_PAGE_ROLE = "CHART PAGE ROLE";
    public static final String FILTERS_PAGE_ROLE = "FILTERS PAGE ROLE";

    
    /** Creates new form StatisticsPage */
    public StatisticsLayout() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        availStatPan = new javax.swing.JPanel();
        filterPan = new javax.swing.JPanel();
        actionPan = new javax.swing.JPanel();
        chartContPan = new javax.swing.JPanel();
        chartPan = new javax.swing.JPanel();
        descriptionPanel = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jXLabel1 = new org.jdesktop.swingx.JXLabel();

        setBackground(new java.awt.Color(153, 153, 153));
        setLayout(new java.awt.GridBagLayout());

        jPanel1.setBackground(new java.awt.Color(153, 153, 153));
        jPanel1.setLayout(new java.awt.GridBagLayout());

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel3.setForeground(new java.awt.Color(255, 255, 255));
        jLabel3.setText("Statistics Controll");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(10, 10, 5, 10);
        jPanel1.add(jLabel3, gridBagConstraints);

        availStatPan.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        jPanel1.add(availStatPan, gridBagConstraints);

        filterPan.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Filters", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(255, 255, 255)));
        filterPan.setOpaque(false);
        filterPan.setLayout(new java.awt.GridBagLayout());
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        jPanel1.add(filterPan, gridBagConstraints);

        actionPan.setOpaque(false);
        actionPan.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        jPanel1.add(actionPan, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.weighty = 1.0;
        add(jPanel1, gridBagConstraints);

        chartContPan.setBackground(new java.awt.Color(153, 153, 153));
        org.jdesktop.swingx.border.DropShadowBorder dropShadowBorder1 = new org.jdesktop.swingx.border.DropShadowBorder();
        dropShadowBorder1.setCornerSize(8);
        dropShadowBorder1.setShadowOpacity(0.4F);
        dropShadowBorder1.setShowLeftShadow(true);
        dropShadowBorder1.setShowTopShadow(true);
        chartContPan.setBorder(dropShadowBorder1);
        chartContPan.setLayout(new java.awt.BorderLayout());

        chartPan.setBackground(new java.awt.Color(255, 255, 255));
        chartContPan.add(chartPan, java.awt.BorderLayout.CENTER);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 5);
        add(chartContPan, gridBagConstraints);

        descriptionPanel.setBackground(new java.awt.Color(153, 153, 153));
        descriptionPanel.setLayout(new java.awt.GridBagLayout());

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        descriptionPanel.add(jLabel4, gridBagConstraints);

        jXLabel1.setForeground(new java.awt.Color(255, 204, 51));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
        descriptionPanel.add(jXLabel1, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        add(descriptionPanel, gridBagConstraints);
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel actionPan;
    private javax.swing.JPanel availStatPan;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JPanel chartContPan;
    private javax.swing.JPanel chartPan;
    private javax.swing.JPanel descriptionPanel;
    private javax.swing.JPanel filterPan;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private org.jdesktop.swingx.JXLabel jXLabel1;
    // End of variables declaration//GEN-END:variables

    @Override
    public void setPage(Page page) {
        PageDSL.fillByRole(page, availStatPan, AVAILABLE_STATISTICS_ROLE);
        PageDSL.fillByRole(page, filterPan, FILTERS_PAGE_ROLE);
        PageDSL.appendActions(page.getActions(), actionPan);
        PageDSL.fillByRole(page, chartPan, CHART_PAGE_ROLE);
        validate();
        repaint();
    }

    @Override
    public void onDispose() {
//        throw new UnsupportedOperationException("Not supported yet.");
    }

}
